import request from '@/utils/request'

// 获取分类列表
export const getCategoryList = (params) => {
    return request({
        url: '/admin/Classify',
        method: 'get',
        params
    })
}

// 新增分类
export const addCategory = (data) => {
    return request({
        url: '/admin/Classify',
        method: 'post',
        data: data
    })
}

// 修改分类
export const updateCategory = (data) => {
    return request({
        url: '/admin/Classify',
        method: 'put',
        data: data
    })
}

// 获取商品列表
export const getGoodsList = (params) => {
    return request({
        url: '/admin/Goods',
        method: 'get',
        params
    })
}

// 添加商品
export const addGoods = (data) => {
    return request({
        url: '/admin/Goods',
        method: 'post',
        data: data
    })
}

// 修改商品
export const updateGoods = (data) => {
    return request({
        url: '/admin/Goods',
        method: 'put',
        data: data
    })
}

// 获取用户列表
export const getUserList = (params) => {
    return request({
        url: '/admin/getUserList',
        method: 'get',
        params
    })
}

// 修改用户密码
export const updateUserPassword = (data) => {
    return request({
        url: '/admin/updatePassword',
        method: 'post',
        data: data
    })
}

// 获取规格列表
export const getGoodSpecList = (params) => {
    return request({
        url: '/admin/GoodsSpec',
        method: 'get',
        params
    })
}

// 添加规格
export const addGoodSpec = (data) => {
    return request({
        url: '/admin/GoodsSpec',
        method: 'post',
        data: data
    })
}

// 修改规格
export const updateGoodSpec = (data) => {
    return request({
        url: '/admin/GoodsSpec',
        method: 'put',
        data: data
    })
}

// 获取套餐
export const getPackageList = (params) => {
    return request({
        url: '/admin/rights',
        method: 'get',
        params
    })
}

// 添加套餐
export const addPackage = (data) => {
    return request({
        url: '/admin/rights',
        method: 'post',
        data: data
    })
}

// 修改套餐
export const updatePackage = (data) => {
    return request({
        url: '/admin/rights',
        method: 'put',
        data: data
    })
}

// 赠送套餐
export const givePackage = (data) => {
    return request({
        url: '/admin/addRightsUser',
        method: 'post',
        data: data
    })
}

// 获取轮播图
export const getBannerList = (params) => {
    return request({
        url: '/admin/banner',
        method: 'get',
        params
    })
}

// 添加轮播图
export const addBanner = (data) => {
    return request({
        url: '/admin/banner',
        method: 'post',
        data: data
    })
}

// 修改轮播图
export const updateBanner = (data) => {
    return request({
        url: '/admin/banner',
        method: 'put',
        data: data
    })
}

// 删除轮播图
export const deleteBanner = (data) => {
    return request({
        url: '/admin/banner',
        method: 'delete',
        data: data
    })
}

// 获取用户标签列表
export const getUserTagList = (params) => {
    return request({
        url: '/admin/UserTag',
        method: 'get',
        params
    })
}

// 添加用户标签
export const addUserTag = (data) => {
    return request({
        url: '/admin/UserTag',
        method: 'post',
        data: data
    })
}

// 获取订单列表
export const getOrderList = (params) => {
    return request({
        url: '/admin/getOrderList',
        method: 'get',
        params
    })
}